/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "sms")
@NamedQueries({
    @NamedQuery(name = "Sms.findAll", query = "SELECT s FROM Sms s")})
public class Sms implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_sms")
    private Integer idSms;
    
    @Column(name = "no_tel")
    private String noTel;
    
    @Column(name = "msisdn")
    private String msisdn;
    @Column(name = "no_akaun")
    private String noAkaun;
    
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "kod_sts_sms")
    private KodStatusSms kodStsSms;
    
    @Column(name = "trh_hantar")
    @Temporal(TemporalType.TIMESTAMP)
    private Date tarikhHantar;
    
    @Column(name = "delivery_notification")
    private String deliveryNotification;

    public Integer getIdSms() {
        return idSms;
    }

    public void setIdSms(Integer idSms) {
        this.idSms = idSms;
    }

    public String getNoTel() {
        return noTel;
    }

    public void setNoTel(String noTel) {
        this.noTel = noTel;
    }

    public String getMsisdn() {
        return msisdn;
    }

    public void setMsisdn(String msisdn) {
        this.msisdn = msisdn;
    }

    public String getNoAkaun() {
        return noAkaun;
    }

    public void setNoAkaun(String noAkaun) {
        this.noAkaun = noAkaun;
    }

    public KodStatusSms getKodStsSms() {
        return kodStsSms;
    }

    public void setKodStsSms(KodStatusSms kodStsSms) {
        this.kodStsSms = kodStsSms;
    }

    public Date getTarikhHantar() {
        return tarikhHantar;
    }

    public void setTarikhHantar(Date tarikhHantar) {
        this.tarikhHantar = tarikhHantar;
    }

    public String getDeliveryNotification() {
        return deliveryNotification;
    }

    public void setDeliveryNotification(String deliveryNotification) {
        this.deliveryNotification = deliveryNotification;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSms != null ? idSms.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sms)) {
            return false;
        }
        Sms other = (Sms) object;
        if ((this.idSms == null && other.idSms != null) || (this.idSms != null && !this.idSms.equals(other.idSms))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "th.model.Sms[ idSms=" + idSms + " ]";
    }
    
}
